<?php


namespace app\admin\validates;


use think\Validate;

class DutiesValidate extends Validate
{
    /**
     * 验证规则
     * @var array
     */
    protected $rule = [
        'id' => 'require|number',
        'name' => 'require|chsDash|max:50',
        'sort' => 'number',
    ];

    /**
     * 验证字段描述
     * @var string[]
     */
    protected $field = [
        'id' => 'ID',
        'name' => '职务名称',
        'sort' => '排序',
    ];

    /**
     * 验证场景
     * @var array
     */
    protected $scene = [
        'add' => ['name', 'sort'],
        'edit' => ['id', 'name', 'sort'],
        'del' => ['id'],
        'details' => ['id']
    ];
}